import { Component, OnInit } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { Router } from '@angular/router';

@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.css']
})
export class LoginComponent implements OnInit {
  user = new User('admin', '1234abcd');
  constructor(private router: Router) {
  }
  ngOnInit() {
    if (sessionStorage.topNav) {
      sessionStorage.removeItem('topNav');
    }
  }
  login(userInfo: User) {
    if ( true ) {
      this.router.navigate(['/index/default'])
    }
  }

}

export class User {

  constructor(
    public username: string,
    public password: string
    ) {

  }
}
